using System.Collections.Generic;
using abilities.effects;

namespace abilities.templates
{
    public class EffectHitDataTemplate : EffectTemplate
    {
        List<int> damage = new ();
        public int area{ get; private set; }
        public int projectile { get; private set; }
        public bool resetTargets { get; private set; }

        public EffectHitDataTemplate() : base()
        {
            this.area = 0;
            this.projectile = 0;
        }

        public override Effect CreateInstance(int level)
        {
            return new EffectHitData(this,level);
        }

        public override bool FromJson(LitJson.JsonData value)
        {
            if (!base.FromJson(value))
                return false;

            FromJsonToArray(value["damage"], damage);
            area = (int)value["area"];
            projectile = (int)value["projectile"];
            resetTargets = (bool)value["resetTargets"];

            return true;
        }


        public int getDamage(int level)
        {
            return GetByLevel(damage, level);
        }

    }
}